package com.small.account.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.small.account.mapper.AuRoleMapper;
import com.small.account.service.IAuRoleService;
import com.small.account.entity.AuRole;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**

 * 角色 服务实现类

 *
 * @author wangguochao
 * @since 2020-01-06
 */
@Service
public class AuRoleServiceImpl extends ServiceImpl<AuRoleMapper, AuRole> implements IAuRoleService {

    @Resource
    private AuRoleMapper auRoleMapper;
    @Override
    public int findByName(String roleName ,String id) {
        QueryWrapper<AuRole> query = new QueryWrapper<>();
        query.eq("role_name", roleName);
        query.ne("id", id);
        return count(query);
    }

}
